From: Jasper St. Pierre Date: Thu, 14 Mar 2013 20:58:20 +0000 (-0400) Subject: background: Fix math to calculate the interval from the duration X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4465 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=eeea8559b69e1cae87f89d6dd60ed8d2ef5deb51;p=gnome-shell.git background: Fix math to calculate the interval from the duration The math here before was incorrect. This is still wrong, as we're looking at the total duration of the animation rather than the next step. https://bugzilla.gnome.org/show_bug.cgi?id=695882 --- diff --git a/js/ui/background.js b/js/ui/background.js index 9e3e0099d..bf8757eac 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -442,8 +442,11 @@ const Background = new Lang.Class({ if (!this._animation.duration) return; + let nSteps = 255 / ANIMATION_OPACITY_STEP_INCREMENT; + let timePerStep = (this._animation.duration * 1000) / nSteps; + let interval = Math.max(ANIMATION_MIN_WAKEUP_INTERVAL * 1000, - ANIMATION_OPACITY_STEP_INCREMENT / this._animation.duration); + timePerStep); this._animationUpdateTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, interval, Lang.bind(this, function() {